package com.woniu.service.impl;

import com.woniu.entity.OrderItem;
import com.woniu.mapper.OrderItemMapper;
import com.woniu.service.OrderItemService;
import com.woniu.util.ResponseEnum;
import com.woniu.util.ResponseUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderItemServiceImpl implements OrderItemService {
    @Resource
    private OrderItemMapper orderItemMapper;

    @Override
    public ResponseUtil findOrderDetail(String orderId) {
        List<OrderItem> all = orderItemMapper.findOrderDetail(orderId);
        return !all.isEmpty() ? ResponseUtil.get(ResponseEnum.OK, all)
                : ResponseUtil.get(ResponseEnum.FAIL);
    }
}
